<?php

class Application_Model_DbTable_BusquedasCategorias extends Zend_Db_Table_Abstract
{

    protected $_name = 'busquedascategorias';

	public function getCategorias() {
		$select  = $this->_db->select()
			->from($this->_name);

		$result = $this->getAdapter()->fetchAll($select);

		return $result;
	}
	
	public function getCategoriasList() {
		$select  = $this->_db->select()
			->from($this->_name,array('key' => 'id','value' => 'nombre'));

		$result = $this->getAdapter()->fetchAll($select);

		return $result;
	}
	
	public function getCategoriasFromId($idCategoria) {
		$select  = $this->_db->select()
			->from($this->_name,array('nombre'))
			->where('id = ?',$idCategoria);

		$result = $this->getAdapter()->fetchAll($select);

		return $result;
	}
}

